angular.module('myApp')
.controller('ButtonCtrl', ['$scope', 'MessageBox', 'DataService', function($scope, MessageBox, DataService) {
  $scope.loading = false;
  console.log(DataService.get());
  $scope.onClick = () => {
    $scope.loading = true;
    // MessageBox.alert('操作成功！', '提示')
    // .then(() => console.log('Alert 关闭'));
    MessageBox.confirm('确定删除此文件吗？', '确认')
      .then(() => {
        $scope.loading = false;
        console.log('用户点击了确定')
      })
      .catch(() => console.log('用户点击了取消'));
    console.log(123);
  }
}])
.directive('elPopconfirm', ['$document', '$timeout', elPopconfirm])
.directive('elButton', elButton);